home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / login / login.c < prev    next >
C/C++ Source or Header  |  1996-07-22  |  845b  |  28 lines

  1. #include "cblogin.h"            
  2.  
  3. void login(char *name)
  4. {
  5.     int                    
  6.     state,
  7.     uid;
  8.         
  9.     switch (getstate(&state, &uid))     /* do appropriate task */
  10.     {
  11.         case -2:                        /* this shouldn't happen: cbmgetty  */
  12.                                         /* should have forced the enable-   */
  13.                                         /* state                            */
  14.             log(log_off, "Unexpected force-enable state");         
  15.  
  16.             enable_state();             /* make the enable-state */
  17.         /* FALLING THROUGH */
  18.  
  19.         case -1:
  20.             first_login(name);          /* state ok: first login */
  21.         break;
  22.         
  23.         case 0:
  24.         default:                        /* default: callback attempt,   */
  25.             exec_login(uid);        /* run original login           */
  26.     }
  27. }
  28.